package com.dog.basics.bean.dto.admin.common;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @description: 公共协议实体接收
 * @author: He
 * @date: Created in 2020/10/14 9:30
 * @version: 1.0
 * @modified By:
 */
@Data
@ApiModel(value = "协议实体")
public class NettyTreatyAdminDto {

    /**
     * 消息类型 : 5-远程在线升级 6-远程重启 7-远程关机 8-远程自定义控制
     */
    @ApiModelProperty(value = "消息类型:[5-远程在线升级 6-远程重启 7-远程关机 8-远程自定义控制]" ,dataType = "Integer",required = true)
    @NotNull(message = "命令消息类型不能为空")
    @Min(value = 5,message = "消息类型支持:[远程在线升级丶远程重启丶远程关机丶远程自定义控制]")
    @Max(value = 8,message = "消息类型支持:[远程在线升级丶远程重启丶远程关机丶远程自定义控制]")
    private Integer msgType;

    /**
     * 设备标识
     */
    @ApiModelProperty(value = "设备标识数组(查询时候只接收第一个)" ,dataType = "List<Long>",required = true)
    @NotNull(message = "设备标识信息不能为空")
    private List<Long> devIds;

    /**
     * 自定义数值
     */
    @ApiModelProperty(value = "自定义控制指令",dataType = "Integer")
    @Max(value = 9999999,message = "自定义指令最大长度[9999999]")
    private Integer customVal;

    /**
     * 固件标识
     */
    @ApiModelProperty(value = "在线升级固件版本标识[远程在线升级使用,不选择则直接升级最新]",dataType = "Long")
    @Min(value = 2 ,message = "固件标识长度[2-20]")
    @Max(value = 20,message = "固件标识长度[2-20]")
    private Long versionId;

}
